<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
var ctx = document.createElement('canvas').getContext('2d');

function checkPixel(x, y, rgb) {
    assert_array_equals(ctx.getImageData(x, y, 1, 1).data.slice(0,3), rgb);
}

test(function(t) {
    
    ctx.fillStyle = "green";
    ctx.fillRect(0, 0, 100, 100);
    ctx.shadowColor = "green";
    ctx.shadowOffsetX = 0;
    ctx.shadowOffsetY = 0;
    ctx.shadowBlur = 0;
    checkPixel(1, 0, [0, 128, 0]);
    
    ctx.clearRect(0, 0, 200, 50);
    ctx.shadowColor = "green";
    ctx.shadowOffsetX = 100;
    ctx.shadowOffsetY = 0;
    ctx.shadowBlur = 2;
    ctx.fillStyle = "green";
    ctx.fillRect(0, 0, 100, 50);
    checkPixel(111, 10, [0, 128, 0]);
    
}, "Some tests for Canvas shadows");
</script>
</body>
